//
//  ALStatusBottomView.swift
//  ALSinaWeiBoSwift
//
//  Created by 柴瑞军 on 16/4/15.
//  Copyright © 2016年 myCompany. All rights reserved.
//

import UIKit

class ALStatusBottomView: UIView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        preparaUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func preparaUI(){
//   添加控件
        addSubview(retweetButton)
        addSubview(commentButton)
        addSubview(likeButton)
        addSubview(separatorFirst)
        addSubview(separatorSecond)
//   设置约束
        retweetButton.snp_makeConstraints { (make) in
            make.top.leading.bottom.equalTo(self)
        }
        
        commentButton.snp_makeConstraints { (make) in
            make.top.bottom.equalTo(self)
            make.leading.equalTo(retweetButton.snp_trailing)
            make.width.equalTo(retweetButton)
        }
        likeButton.snp_makeConstraints { (make) in
            make.leading.equalTo(commentButton.snp_trailing)
            make.top.trailing.bottom.equalTo(self)
            make.width.equalTo(retweetButton)
        }
        
        //分割线的约束
        
        separatorFirst.snp_makeConstraints { (make) in
            make.centerY.equalTo(retweetButton)
            make.centerX.equalTo(retweetButton.snp_trailing)
        }
        separatorSecond.snp_makeConstraints { (make) in
            make.centerY.equalTo(commentButton)
            make.centerX.equalTo(commentButton.snp_trailing)
        }
    }
    
    
//  懒加载控件
   //转发按钮
    private lazy var retweetButton:UIButton = UIButton(image: "timeline_icon_retweet", title: "转发")
    // 评论按钮
    private lazy var commentButton:UIButton = UIButton(image: "timeline_icon_comment", title: "评论")
    //赞
    private lazy var likeButton:UIButton = UIButton(image: "timeline_icon_unlike", title: "我")
    
    //button之间的竖线
    //分割线1
    private lazy var separatorFirst : UIImageView = UIImageView(imageNamed: "timeline_card_bottom_line")
    
    //分割线2
    private lazy var separatorSecond:UIImageView = UIImageView(imageNamed: "timeline_card_bottom_line")
}
